﻿
<script src="../assets/js/jquery.js"></script>
<script src="../assets/js/jquery.datetimepicker.full.js"></script>
<!--<link rel="stylesheet" type="text/css" href="../assets/css/datetimepicker.css" />-->
<div ng-controller="selectBackgroundInformationController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default"
                           data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">消息管理</h4>
                </div>
                <div class="panel-body">
                    <!--<div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right">
                                    <button class="btn btn-sm btn-info" ng-click="reflash()">
                                        <i class="fa fa-search"></i> 筛选
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>-->

                    <div class="h_bmessage">
                        <form class="form-horizontal col-md-12" role="form" id="h_Form">
                            <div class="userTpye">
                                <div class="col-md-2 col-sm-2 col-xs-2">用户类型：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" checked="checked" name="customerTypeCode" style="height: 15px" value="0"> 个人
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="customerTypeCode" style="height: 15px" value="301"> 绑定企业
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="customerTypeCode" style="height: 15px" value="302"> 绑定兴业账户
                                </span>
                            </div>
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">用户等级：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" checked="checked" name="customerLevelId" style="height: 15px" value="0"> 普通用户
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="customerLevelId" style="height: 15px" value="0"> VIP用户
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="customerLevelId" style="height: 15px" value="0"> 白金会员
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="customerLevelId" style="height: 15px" value="0"> 黄金会员
                                </span>
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">交易时间：</div>
                                    <span class="col-md-4 col-sm-4 col-xs-4">起始时间：
                                        <input type="text" placeholder="请输入交易起始时间" id="start_time" name="start_time" style="width:50%;margin-top:-7%;margin-left:24%;" class="form-control" />
                                    </span>
                                    <span class="col-md-4 col-sm-4 col-xs-4">终止时间：
                                        <input type="text" placeholder="请输入交易终止时间" id="end_time" name="end_time" style="width:50%;margin-top:-7%;margin-left:24%;" class="form-control" />
                                    </span>
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">注册时间：</div>
                                    <span class="col-md-4 col-sm-4 col-xs-4">
                                        起始时间：
                                        <input type="text" placeholder="请输入注册起始时间" id="hstart_time" name="hstart_time" style="width:50%;margin-top:-7%;margin-left:24%;" class="form-control" />
                                    </span>
                                    <span class="col-md-4 col-sm-4 col-xs-4">
                                        终止时间：
                                        <input type="text" placeholder="请输入注册终止时间" id="hend_time" name="hend_time" style="width:50%;margin-top:-7%;margin-left:24%;" class="form-control" />
                                    </span>
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">交易类型：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" checked="checked" name="traderLevelCode" style="height: 15px" value="1"> 买家
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="traderLevelCode" style="height: 15px" value="2"> 卖家
                                </span>
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">票据类型：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" checked="checked" name="billTypeId" style="height: 15px" value="101"> 电票
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="billTypeId" style="height: 15px" value="102"> 纸票
                                </span>
                                <!--<hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">交易地点：</div>
                                <div class="col-md-10 form-inline">
                                    <select class="form-control width-150" ng-model="model.product_location_province_id" ng-options="item.id as item.address_name for item in provinceData" ng-change="provinceChange()"><option value="">省(或直辖市)</option></select>
                                    <select class="form-control width-150" ng-model="model.product_location_id" ng-options="item.id as item.address_name for item in cityData"><option value="">市</option></select>
                                </div>-->
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="form-inline filter-option">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="pull-left hp_f">
                                                <button class="btn btn-sm btn-info" style="height:43px; border:0;border-radius:3px; background-color:#f55a14;font-size:18px;color:#fff;" ng-click="hpxFindS()">
                                                    我要查询
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>    
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="form-inline filter-option">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="pull-right">
                                                <!--<input type="text" ng-model="filter.keyword" class="form-control input-sm"
                                                       placeholder="关键词" />
                                                <button class="btn btn-sm btn-info" ng-click="reflash()">
                                                    <i class="fa fa-search"></i> 筛选
                                                </button>-->
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="hm">
                                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html"
                                           class="table">
                                        <tr ng-repeat="item in $data">
                                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                                            <!--<td data-title="'全选'" class="text-center">{{item}}</td>-->
                                            <td data-title="'企业编号'" sortable="'id'" class="text-center">{{item.id}}</td>
                                            <td data-title="'用户名'" sortable="'username'" class="text-center">{{item.customer_name}}</td>
                                        </tr>
                                    </table>
                                </div>
                                
                                <hr class="col-md-12" style="width: 95%; margin-top:56px;background-color: #999;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">发送消息的标题：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="text" name="notification_title" class="form-control" ng-model="model.notification_title" style="height:32px" value="">
                                </span>
                                
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">消息类型：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0;width:12%;">
                                    <input type="radio" checked="checked" name="notification_type" style="height: 15px" value="1"> 注册消息
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding: 0;width:12%;">
                                    <input type="radio" name="notification_type" style="height: 15px" value="2"> 出票订单消息
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding: 0;width:12%;">
                                    <input type="radio" name="notification_type" style="height: 15px" value="3"> 发布票据消息
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding: 0;width:12%;">
                                    <input type="radio" name="notification_type" style="height: 15px" value="4"> 其他消息
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding: 0;width:12%;">
                                    <input type="radio" name="notification_type" style="height: 15px" value="5"> 收票订单消息
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding: 0;width:12%;">
                                    <input type="radio" name="notification_type" style="height: 15px" value="6"> 竞价票据消息
                                </span>

                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">发送类型：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" checked="checked" name="news_type" style="height: 15px" value="1"> 活动消息
                                </span>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="radio" name="news_type" style="height: 15px" value="2"> 节假日消息
                                </span>

                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">活动标题：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="text" name="activity_period" class="form-control" ng-model="model.activity_period" style="height: 32px" value="">
                                </span>

                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">活动名称：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="text" name="activity_name" class="form-control" ng-model="model.activity_name" style="height: 32px" value="">
                                </span>

                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">活动礼物：</div>
                                <span class="col-md-2 col-sm-2 col-xs-2" style="padding-top: 0">
                                    <input type="text" name="things" class="form-control" ng-model="model.things" style="height: 32px" value="">
                                </span>

                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="col-md-2 col-sm-2 col-xs-2">发送时间：</div>
                                <input type="text" placeholder="请输入发送时间" id="hsend_time" name="hsend_time" style="width:22%;padding-left:12px;" class="form-control" />
                                <!--<input type="date" placeholder="请输入发送时间" ng-model="model.dates" name="hsend_time" style="width:22%;" class="form-control" />-->
                                <hr class="col-md-12" style="width: 95%; margin-top:0;" />
                                <div class="form-inline filter-option">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="pull-left h_f">
                                                <button class="btn btn-sm btn-info" ng-click="hpxSend()" style="width: 100px;height: 40px;font-size: 20px;">
                                                    发送
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

    <script>
        /*
        window.onerror = function(errorMsg) {
	        $('#console').html($('#console').html()+'<br>'+errorMsg)
        }*/

        $.datetimepicker.setLocale('en');

        $('#datetimepicker_format').datetimepicker({value:'2015/04/15 05:03', format: $("#datetimepicker_format_value").val()});
        console.log($('#datetimepicker_format').datetimepicker('getValue'));

        $("#datetimepicker_format_change").on("click", function(e){
	        $("#datetimepicker_format").data('xdsoft_datetimepicker').setOptions({format: $("#datetimepicker_format_value").val()});
        });
        $("#datetimepicker_format_locale").on("change", function(e){
	        $.datetimepicker.setLocale($(e.currentTarget).val());
        });

        $('#datetimepicker').datetimepicker({
        dayOfWeekStart : 1,
        lang:'en',
        disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
        startDate:	'1986/01/05'
        });
        $('#datetimepicker').datetimepicker({value:'2015/04/15 05:03',step:10});

        $('.some_class').datetimepicker();

        $('#default_datetimepicker').datetimepicker({
	        formatTime:'H:i',
	        formatDate:'d.m.Y',
	        //defaultDate:'8.12.1986', // it's my birthday
	        defaultDate:'+03.01.1970', // it's my birthday
	        defaultTime:'10:00',
	        timepickerScrollbar:false
        });

        $('#datetimepicker10').datetimepicker({
	        step:5,
	        inline:true
        });
        $('#datetimepicker_mask').datetimepicker({
	        mask:'9999/19/39 29:59'
        });

        $('#datetimepicker1').datetimepicker({
	        datepicker:false,
	        format:'H:i',
	        step:5
        });
        $('#datetimepicker2').datetimepicker({
	        yearOffset:222,
	        lang:'ch',
	        timepicker:false,
	        format:'d/m/Y',
	        formatDate:'Y/m/d',
	        minDate:'-1970/01/02', // yesterday is minimum date
	        maxDate:'+1970/01/02' // and tommorow is maximum date calendar
        });
        $('#datetimepicker3').datetimepicker({
	        inline:true
        });
        $('#datetimepicker4').datetimepicker();
        $('#open').click(function(){
	        $('#datetimepicker4').datetimepicker('show');
        });
        $('#close').click(function(){
	        $('#datetimepicker4').datetimepicker('hide');
        });
        $('#reset').click(function(){
	        $('#datetimepicker4').datetimepicker('reset');
        });
        $('#datetimepicker5').datetimepicker({
	        datepicker:false,
	        allowTimes:['12:00','13:00','15:00','17:00','17:05','17:20','19:00','20:00'],
	        step:5
        });
        $('#datetimepicker6').datetimepicker();
        $('#destroy').click(function(){
	        if( $('#datetimepicker6').data('xdsoft_datetimepicker') ){
		        $('#datetimepicker6').datetimepicker('destroy');
		        this.value = 'create';
	        }else{
		        $('#datetimepicker6').datetimepicker();
		        this.value = 'destroy';
	        }
        });
        var logic = function( currentDateTime ){
	        if (currentDateTime && currentDateTime.getDay() == 6){
		        this.setOptions({
			        minTime:'11:00'
		        });
	        }else
		        this.setOptions({
			        minTime:'8:00'
		        });
        };
        $('#datetimepicker7').datetimepicker({
	        onChangeDateTime:logic,
	        onShow:logic
        });
        $('#datetimepicker8').datetimepicker({
	        onGenerate:function( ct ){
		        $(this).find('.xdsoft_date')
			        .toggleClass('xdsoft_disabled');
	        },
	        minDate:'-1970/01/2',
	        maxDate:'+1970/01/2',
	        timepicker:false
        });
        $('#datetimepicker9').datetimepicker({
	        onGenerate:function( ct ){
		        $(this).find('.xdsoft_date.xdsoft_weekend')
			        .addClass('xdsoft_disabled');
	        },
	        weekends:['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'],
	        timepicker:false
        });
        var dateToDisable = new Date();
	        dateToDisable.setDate(dateToDisable.getDate() + 2);
        $('#datetimepicker11').datetimepicker({
	        beforeShowDay: function(date) {
		        if (date.getMonth() == dateToDisable.getMonth() && date.getDate() == dateToDisable.getDate()) {
			        return [false, ""]
		        }

		        return [true, ""];
	        }
        });
        $('#datetimepicker12').datetimepicker({
	        beforeShowDay: function(date) {
		        if (date.getMonth() == dateToDisable.getMonth() && date.getDate() == dateToDisable.getDate()) {
			        return [true, "custom-date-style"];
		        }

		        return [true, ""];
	        }
        });
        $('#datetimepicker_dark').datetimepicker({theme:'dark'})


    </script>


